package com.itheima.service;

import com.itheima.domain.Linkman;
import org.springframework.transaction.annotation.Transactional;

import com.itheima.dao.LinkmanDao;

import java.util.List;

@Transactional
public class LinkmanService {
	private LinkmanDao dao;

    public void setDao(LinkmanDao dao) {
		this.dao = dao;
	}


    public void saveAdd(Linkman linkman) {
		dao.saveAdd(linkman);
    }

	public List list() {
		return dao.list();
	}

	public void delete(Linkman linkman) {
		Linkman l = dao.findOne(linkman);
		dao.delete(l);
	}

	public List likeSerch(Linkman linkman) {
		return dao.likeSerch(linkman);
	}

	public Linkman edit(Linkman linkman) {
        Linkman l = dao.findOne(linkman);
        return l;
    }

    public void saveEdit(Linkman linkman) {
        dao.saveEdit(linkman);
    }
}
